package com.teach.flavour.controller;

import com.common.bean.Response;
import com.teach.flavour.model.dto.AssociatorFlavourDTO;
import com.teach.service.OrdersService;
import io.swagger.annotations.*;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestParam;

import com.teach.flavour.service.impl.AssociatorFlavourServiceImpl;
import com.teach.flavour.model.po.AssociatorFlavour;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 会员口味表 前端控制器
 * </p>
 * @version 1.0
 * @author hzz
 * @since 2020-03-11
 */
@RestController
@RequestMapping("/associatorFlavour")
public class AssociatorFlavourController {
    @Autowired
    private AssociatorFlavourServiceImpl serviceAssociatorFlavour;


    /**
     * 信息
     */
    @ApiOperation("详情查询")
    @RequestMapping("/info")
    public Response<AssociatorFlavour> info(@RequestParam("id") String id){
		AssociatorFlavour info = serviceAssociatorFlavour.getById(id);

        return Response.ok(info);
    }
    /**
     * 删除
     */
    @ApiOperation("推荐")
    @RequestMapping("/getlike")
    public Response<Object> getLike(@RequestParam("associatorId")String id){
        return Response.ok(serviceAssociatorFlavour.getLike(id));
    }
    /**
     * 保存
     */
    @ApiOperation("保存")
    @PostMapping("/save")
    public Response<Object> addTextValue(@RequestBody(required = true) AssociatorFlavour entity){
        serviceAssociatorFlavour.saveValue(entity);
        return Response.ok(null);
    }
}

